A good answer might be:

First  value of the local var: 7 
First  value of the parameter: 7
Second value of the parameter: 100
Second value of the local var: 7

Returning a Value

Once the value has been passed into the invoked method (in the example, print()) the invoked method can use it or change it, but the changes do not affect the caller. But say that the invoked method needs to send a value back to the caller. How can it do that? Examine the following:

class SimpleClassTwo
{
  public int twice( int x )
  {
    return 2*x;
  }
}

class SimpleTesterTwo
{
  public static void main ( String[] args )
  {
    int var = 7;
    int result = 0;

    SimpleClassTwo simple = new SimpleClassTwo();

    System.out.println("First  value of result: " + result );    
    result = simple.twice( var );
    System.out.println("Second value of result: " + result );    
  }
}

QUESTION 5:

Now what is the output of the program?

First  value of the result: 
Second value of the result: